﻿/*
 * Copyright © 2025−2026 WEI.ZHOU (Willis) (Chengdu). All rights reserved.
 *
 * THIS SOURCE CODE IS PROPRIETARY AND CONFIDENTIAL.
 * It is the exclusive property of WEI.ZHOU (Willis) and may not be
 * used, copied, distributed, or disclosed outside of WEI.ZHOU (Willis)
 * without express written permission.
 *
 * This code is provided to WEI.ZHOU (Willis) under a limited,
 * non-transferable internal license, and is for use only with the author's
 * approved purposes. No external license is granted or implied.
 *
 * Any unauthorized use, reproduction, or distribution is strictly prohibited
 * and may result in severe civil and criminal penalties.
 */

using Aore.Core.Repository.Dapper;
using Aore.Core.Repository.EFCore;
using Aore.IRepository.User;
using Aore.Models.ServiceModels.User;

namespace Aore.Repository.User;

public class UserRepository : IUserRepository
{
  private readonly IEfRepository<Users> _repository;
  
  private readonly IDbRepository<Users> _dbRepository;
  
  public UserRepository(IEfRepository<Users> repository, IDbRepository<Users> dbRepository)
  {
    _repository = repository;
    _dbRepository = dbRepository;
  }
  public List<Models.ServiceModels.User.User> GetUsers()
  {
    return new List<Models.ServiceModels.User.User>()
    {
      new Models.ServiceModels.User.User(){Id = "1", Name = "Aore", Email = "aore.dev"},
      new Models.ServiceModels.User.User(){Id = "2", Name = "Aore", Email = "aore.dev"}
    };
  }

  public List<Users> GetUsersR2()
  {
    var data = _dbRepository.GetAll().ToList();
    return data;
    //return _repository.GetAllAsync().Result.ToList();
  }
}